<template>
    <div class="PrintSetting-container">
        <CommonPrintTem ref="CommonPrintTemRef" :selector="selector" :font-size="form.fontSize"></CommonPrintTem>
    </div>
</template>
  
<script setup lang="ts">
import { ref, watch } from "vue";
import CommonPrintTem from './CommonPrintTem.vue'
import htmlToPdfProof from '@/utils/htmlToPdfProof'
const props = defineProps({
    selector: {
        type: String,
        default: ''
    }
})
const CommonPrintTemRef = ref()
const form = ref({
    top: 0,
    bottom: 0,
    left: 10,
    right: 10,
    fontSize: '14px'
})
const showPrintSettingCon = async (name) => {
    await CommonPrintTemRef.value.buildDom()
    htmlToPdfProof.getPdf(CommonPrintTemRef.value.$el, form.value, () => {
        CommonPrintTemRef.value.clearDom()
    }, name)
}
defineExpose({
    showPrintSettingCon
})
</script>
  
<style lang="less" scoped></style>